1) Field of the Invention
The present invention relates to a method of writing recording data that has a variable-length data format in a data-storage unit that processes data in a fixed-length format, and a channel adapter that executes the method of writing.
2) Description of the Related Art
In a main-frame system that runs on vendor's own operating system, a magnetic-disc unit that has a data format of variable-length records has been used as an external storage unit. In the data format of variable-length records, a record includes three fields viz, a count, a key, and data and is called as CKD (count, key, data) format. In the CKD format, one data is managed as a unit of one record.
On the other hand, a disc array unit (also called as RAID (Redundant Arrays of Inexpensive Disks) has been used a lot as the external storage unit that is used in an information processing system. The disc array unit has a structure that enables a high-speed data access and an improved fault-resistance of data. The disc array system being used a lot in an open system that is operated by a general purpose operating system of different type, has a data format of a fixed-length record. For example, in a normal disc-access unit, data is stored according to a logical block where one logical block includes 512 bytes.
In recent years, with the progress in information processing technology, information-processing terminals have become prevalent, and in many cases the information-processing system is built by mixing a main-frame system and an open system. Therefore, in the disc array unit that stores data in a data format of fixed length, a unit with a configuration that enables data access even from the main-frame system, has been proposed in Japanese Patent Application Laid-open Application No. 2002-55862.
However, while storing the data in the external storage unit, when the data that is stored is to be read again, an error-checking code for judging if there is an error is attached to the data. For example, in a CKD format of the main-frame system, an error check is performed for each field that is included in the record and a code that indicates result of the error check is attached to a tail end of the field. Moreover, in the fixed-length data format of the open system, the error check is performed for each logical block and a code that indicates result of the error check is attached to a tail end of the logical block.
FIG. 11 is a schematic diagram of a data structure in which the block-checking code is attached for each logical block that is used in the open system. Logical blocks 110A to 110C include data sections 115A to 115C and block-checking codes 120A to 120C of predetermined lengths added to the data sections 115A to 115C. At this point, a request for update of data 150 that includes the three logical blocks 110A to 110C is made. When the request is made, content of data of the logical blocks 110A and 110C is let to be updated, but due to some fault, content of data of the logical block 110B is not let to be updated and the data of the logical block 110B is as it is without any change. If data 150 of the logical blocks 110A to 110C is read, even if the error check is performed, since the block-checking code 120A and 120C of the logical blocks 110A and 110c that are updated and the block-checking code 120B of the logical block 110B that is not updated are correct, a fault that the logical block 110B was not updated, cannot be detected. In the main-frame system, if data that was supposed to be updated similarly could not be updated in units of fields, the fault cannot be detected.